package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 备件使用记录管理对象 usage_records
 *
 * @author ruoyi
 * @date 2025-03-19
 */
public class UsageRecords extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 使用记录唯一标识
     */
    private Long recordId;

    /**
     * 使用记录编号
     */
    @Excel(name = "使用记录编号")
    private String recordCode;

    /**
     * 备件编号
     */
    @Excel(name = "备件编号")
    private String sparePartNo;

    /**
     * 备件名称
     */
    @Excel(name = "备件名称")
    private String sparePartName;

    /**
     * 使用数量
     */
    @Excel(name = "使用数量")
    private Long quantityUsed;

    /**
     * 使用原因（如：维护、测试）
     */
    @Excel(name = "使用原因", readConverterExp = "如=：维护、测试")
    private String usageReason;

    /**
     * 使用发生时间
     */
    @Excel(name = "使用发生时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date usageTime;

    public void setRecordId(Long recordId) {
        this.recordId = recordId;
    }

    public Long getRecordId() {
        return recordId;
    }

    public void setRecordCode(String recordCode) {
        this.recordCode = recordCode;
    }

    public String getRecordCode() {
        return recordCode;
    }

    public void setSparePartNo(String sparePartNo) {
        this.sparePartNo = sparePartNo;
    }

    public String getSparePartNo() {
        return sparePartNo;
    }

    public void setSparePartName(String sparePartName) {
        this.sparePartName = sparePartName;
    }

    public String getSparePartName() {
        return sparePartName;
    }

    public void setQuantityUsed(Long quantityUsed) {
        this.quantityUsed = quantityUsed;
    }

    public Long getQuantityUsed() {
        return quantityUsed;
    }

    public void setUsageReason(String usageReason) {
        this.usageReason = usageReason;
    }

    public String getUsageReason() {
        return usageReason;
    }

    public void setUsageTime(Date usageTime) {
        this.usageTime = usageTime;
    }

    public Date getUsageTime() {
        return usageTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("recordId", getRecordId())
                .append("recordCode", getRecordCode())
                .append("sparePartNo", getSparePartNo())
                .append("sparePartName", getSparePartName())
                .append("quantityUsed", getQuantityUsed())
                .append("usageReason", getUsageReason())
                .append("usageTime", getUsageTime())
                .append("remark", getRemark())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .toString();
    }
}
